from django.db import models
from django.contrib.auth.models import User

# Create your models here.
class WallKind(models.Model):
    kind_name = models.CharField(max_length = 20)
    exchange_number = models.IntegerField()

class WallList(models.Model):
    wallkind = models.ForeignKey(WallKind)
    title = models.CharField(max_length = 128)
    content = models.TextField()
    img = models.ImageField(upload_to = "wall",null = True, blank = True)
    user = models.ForeignKey(User)
    comments_num = models.IntegerField()
    creat_time = models.DateTimeField(auto_now = False, auto_now_add = True)
    modify_time = models.DateTimeField(auto_now = True, auto_now_add = False)

class WallComments(models.Model):
    wall = models.ForeignKey(WallList)
    user = models.ForeignKey(User)
    content = models.TextField()
    time = models.DateTimeField(auto_now = False, auto_now_add = True)


